package com.cj.user.service.datastructure;

/**
 * @Author cheng jun
 * @Description: 链表
 * @Date 2021/7/17 15:14
 */
public class Node {

    /**
     * 指针
     */
    public Node next;

    /**
     * 数据
     */
    private Object data;

    public Node() {
    }

    public Node(Object data) {
        this.data = data;
        this.next = null;
    }

    public void insert(Object data1, Object data2, Object data3) {
        Node node = new Node(data1);
        node.next = new Node(data2);
        node.next.next = new Node(data3);
        System.out.println(node.data);
        System.out.println(node.next.data);
        System.out.println(node.next.next.data);
    }

    public static void main(String[] args) {
        new Node().insert("111", "222", "333");
    }
}
